package final2107.day06;

public class LazySingletonTest {
    public static void main(String[] args) {
//        LazySingleton singleton1 = LazySingleton.getInstance();
//        LazySingleton singleton2 = LazySingleton.getInstance();
//        LazySingleton singleton3 = LazySingleton.getInstance();
//
//        System.out.println(singleton1);
//        System.out.println(singleton2);
//        System.out.println(singleton3);

        Thread thread1 = new Thread(){
            @Override
            public void run() {
                LazySingleton singleton = LazySingleton.getInstance();
                System.out.println(singleton);
            }
        };

        Thread thread2 = new Thread(){
            @Override
            public void run() {
                LazySingleton singleton = LazySingleton.getInstance();
                System.out.println(singleton);
            }
        };

        thread1.start();
        thread2.start();

    }
}
